home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / uucp / wuucp_0_0_29.lha / update-execute.me < prev    next >
AmigaDOS Script File  |  1994-06-14  |  6KB  |  192 lines

  1. .key none
  2. .bra {
  3. .ket }
  4.  
  5. echo "Please READ this script first and remote the 'quit 20'"
  6. echo "command before execution! Don't say I haven't warned you ..."
  7. quit 20  ; remove this command AFTER CAREFULLY checking the contents of this script!
  8.          ; YOU HAVE BEEN WARNED. I DO NOT GUARANTEE THAT THIS SKRIPT WORKS AS
  9.          ; EXPECTED (also it seems to do so =:->).
  10.  
  11. failat 1
  12. set tmpversionid `type version.id`
  13.  
  14. ; first cd into another dir to make sure we find the CORRECT
  15. ; places of the commands we're looking for ... In order to
  16. ; deal with resident commands, remove all, just in case.
  17.  
  18. echo "Removing possibly RESIDENT loaded programs; just ignore the error messages."
  19.  
  20. failat 10
  21. resident remove nikecico2
  22. resident remove uucico
  23. resident remove uucp
  24. resident remove uux
  25. resident remove uuxqt
  26. resident remove getty
  27. resident remove sendmail
  28. resident remove rmail
  29.  
  30. set tmpuuciconame `which uucico`
  31. set tmpuucpname `which uucp`
  32. set tmpuuxname `which uux`
  33. set tmpuuxqtname `which uuxqt`
  34. set tmpgettyname `which getty`
  35. set tmpsendmailname `which sendmail`
  36. set tmprmailname `which rmail`
  37. set tmpnikecico2name `which nikecico2`
  38.  
  39. ; now check wheter we did find all programs; abort on first problem,
  40. ; let the user fix it.
  41.  
  42. get tmpuuciconame
  43. if $RC not eq 0 val
  44.    skip goterror
  45. endif
  46. get tmpuucpname
  47. if $RC not eq 0 val
  48.    skip goterror
  49. endif
  50. get tmpuuxname
  51. if $RC not eq 0 val
  52.    skip goterror
  53. endif
  54. get tmpuuxqtname
  55. if $RC not eq 0 val
  56.    skip goterror
  57. endif
  58. get tmpgettyname
  59. if $RC not eq 0 val
  60.    skip goterror
  61. endif
  62. get tmpsendmailname
  63. if $RC not eq 0 val
  64.    skip goterror
  65. endif
  66.  
  67. set tmpuucpbinpath `list $tmpuuxname lformat "%p"`
  68.  
  69. failat 1
  70.  
  71. echo "*Nrename $tmpuuciconame $tmpuuciconame.pre_$tmpversionid ..."
  72. rename $tmpuuciconame $tmpuuciconame.pre_$tmpversionid
  73. echo "rename $tmpuucpname $tmpuucpname.pre_$tmpversionid ..."
  74. rename $tmpuucpname $tmpuucpname.pre_$tmpversionid
  75. echo "rename $tmpuuxname $tmpuuxname.pre_$tmpversionid ..."
  76. rename $tmpuuxname $tmpuuxname.pre_$tmpversionid
  77. echo "rename $tmpuuxqtname $tmpuuxqtname.pre_$tmpversionid ..."
  78. rename $tmpuuxqtname $tmpuuxqtname.pre_$tmpversionid
  79. echo "rename $tmpgettyname $tmpgettyname.pre_$tmpversionid ..."
  80. rename $tmpgettyname $tmpgettyname.pre_$tmpversionid
  81. echo "rename $tmpsendmailname $tmpsendmailname.pre_$tmpversionid ..."
  82. rename $tmpsendmailname $tmpsendmailname.pre_$tmpversionid
  83. echo "rename $tmprmailname $tmprmailname.pre_$tmpversionid ..."
  84. rename $tmprmailname $tmprmailname.pre_$tmpversionid
  85.  
  86. get tmpnikecico2name
  87. if $RC not eq 0 val
  88.    echo "Seems as if you don't use nikecico2 yet, installing it anyway."
  89.    copy bin/nikecico2 $tmpuucpbinpath clone
  90. else
  91.    echo "rename $tmpnikecico2name $tmpnikecico2name.pre_$tmpversionid ..."
  92.    rename $tmpnikecico2name $tmpnikecico2name.pre_$tmpversionid
  93.    echo "copy bin/nikecico2 $tmpnikecico2name clone ..."
  94.    copy bin/nikecico2 $tmpnikecico2name clone
  95. endif
  96.  
  97. echo "copy bin/uucico $tmpuuciconame clone ..."
  98. copy bin/uucico $tmpuuciconame clone
  99. echo "copy bin/uucp $tmpuucpname clone ..."
  100. copy bin/uucp $tmpuucpname clone
  101. echo "copy bin/uux $tmpuuxname clone ..."
  102. copy bin/uux $tmpuuxname clone
  103. echo "copy bin/uuxqt $tmpuuxqtname clone ..."
  104. copy bin/uuxqt $tmpuuxqtname clone
  105. echo "copy bin/getty $tmpgettyname clone ..."
  106. copy bin/getty $tmpgettyname clone
  107. echo "copy bin/sendmail $tmpsendmailname clone ..."
  108. copy bin/sendmail $tmpsendmailname clone
  109. echo "copy bin/sendmail $tmprmailname clone ..."
  110. copy bin/sendmail $tmprmailname clone
  111.  
  112. echo "*NInstalling auxilary files in $tmpuucpbinpath ..."
  113. copy bin/FeatureRequest bin/BugReport bin/ctime bin/FindConfig bin/MessageID $tmpuucpbinpath clone
  114.  
  115. ; Now send a mail to the author, he just LIKES to get email =;->
  116.  
  117. echo "*NSending message about installation to bugs@hactar.hanse.de ..."
  118.  
  119. set bugreportUSERNAME `findconfig USERNAME`
  120. if "$bugreportUSERNAME" eq "*$USERNAME"
  121.    set bugreportUSERNAME root
  122. endif
  123. set bugreportREALNAME `findconfig REALNAME`
  124. set bugreportHOSTNAME `findconfig NODENAME`
  125. set bugreportEDITOR `findconfig MAILEDITOR`
  126. set bugreportID `messageid`
  127. set bugreportCTIME `ctime rfc`
  128.  
  129. failat 10
  130.  
  131. echo  >t:report.form "To: bugs@hactar.hanse.de"
  132. echo >>t:report.form "From: $bugreportUSERNAME@$bugreportHOSTNAME ($bugreportREALNAME)"
  133. echo >>t:report.form "Sender: BugReport@$bugreportHOSTNAME (Script)"
  134. echo >>t:report.form "Date: $bugreportCTIME"
  135. echo >>t:report.form "Message-ID: <$bugreportID@$bugreportHOSTNAME>"
  136. echo >>t:report.form "Subject: Updated UUCP system to $tmpversionid on $bugreportCTIME"
  137. echo >>t:report.form "X-Report-For: wUUCP/-install-message-*N"
  138. echo >>t:report.form "%id:*N$bugreportID-$bugreportUSERNAME@$bugreportHOSTNAME*N%%*N"
  139. echo >>t:report.form "%path:*N$tmpuuciconame*N%%*N"
  140. echo >>t:report.form "%avail:"
  141. avail >>t:report.form
  142. echo >>t:report.form "%%*N"
  143. set bugreportkludge1 `cpu`
  144. set bugreportkludge2 `version`
  145. echo >>t:report.form "%cpu:*N$bugreportkludge1*N%%*N"
  146. echo >>t:report.form "%ver:*N$bugreportkludge2*N%%*N"
  147. sendmail <t:report.form
  148. unset bugreportUSERNAME
  149. unset bugreportREALNAME
  150. unset bugreportHOSTNAME
  151. unset bugreportEDITOR
  152. unset bugreportID
  153. unset bugreportCTIME
  154. unset bugreportkludge1
  155. unset bugreportkludge2
  156. delete t:report.#?  quiet
  157.  
  158. echo "*NUpdate complete. PLEASE READ THE SUPPLIED 'ChangesSince_Rel#?'-files!"
  159. echo "And don't forget to copy the man-pages in man/ to your favourite directory."
  160.  
  161. skip cleanup
  162.  
  163. lab goterror
  164.  
  165. echo "An error occured, one or more files did not exist yet. You may need"
  166. echo "advise from an experience user -- or a more sophisticated install"
  167. echo "script =:->*N"
  168. echo "NOTE: YOU MAY HAVE TO RENAME ONE OR MORE OF THE FOLLOWING FILES BACK"
  169. echo "      TO THEIR ORIGINAL NAME TO GET YOUR SYSTEM BACK INTO A WORKING"
  170. echo "      STATE!*N"
  171. echo "$tmpuuciconame.pre_$tmpversionid"
  172. echo "$tmpuucpname.pre_$tmpversionid"
  173. echo "$tmpuuxname.pre_$tmpversionid"
  174. echo "$tmpuuxqtname.pre_$tmpversionid"
  175. echo "$tmpgettyname.pre_$tmpversionid"
  176. echo "$tmpsendmailname.pre_$tmpversionid"
  177. echo "$tmprmailname.pre_$tmpversionid"
  178. echo "*NAborting ..."
  179.  
  180. lab cleanup
  181.  
  182. unset tmpversionid
  183. unset tmpuuciconame
  184. unset tmpuucpname
  185. unset tmpuuxname
  186. unset tmpuuxqtname
  187. unset tmpgettyname
  188. unset tmpsendmailname
  189. unset tmprmailname
  190. unset tmpuucpbinpath
  191. unset tmpnikecico2name
  192.